var utils = require('../util/common-util')

/**
 * VO代码生成器
 */
var generator = {
    generate: function (json) {
        var tableFields = json.tableFields
        var code = ''
        var template = '"{name}":1, //{desc}\r\n'
        tableFields.forEach(e => {
            var t = template.replace('{name}', utils.convert2JavaName(e.field))
            code += t.replace('{desc}', e.desc)
        });
        code = '{\r\n' + code + '}'
        return code
    }
}

module.exports = generator